﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Xml.Serialization;
using System.IO;
using System.Text;

namespace ISKConfigurator
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());

            Conf Configuration = new Conf();
            XmlSerializer sr = new XmlSerializer(typeof(Conf));

            FileStream fs = new FileStream("c:\\test.xml", FileMode.Create);
            Configuration.addMsg("NSM", 10, 5, "Task_NSM", "Task_NSM_Sub", "E_Rec", "E_Receive");
            Configuration.addMsg("SYS", 7, 9, "Task_SYS", "Task_SYS_Sub", "E_c", "E_Re");

            sr.Serialize(fs, Configuration);
            fs.Close();

            StreamWriter lFiles = new StreamWriter("c:\\test.c");
            StringBuilder lText = new StringBuilder();
            // lText.Append("#define " + Configuration.Msgs[0].Name);
            lFiles.Write(lText.ToString());
            lFiles.Flush();
            lFiles.Close();

            //myForm.test_LoadXml();
        }


    }
}
